package android.cmpe451.group7.entity;

import java.io.Serializable;

/**
 * Entity class for tags.
 */
public class Tag implements Serializable {

	private static final long serialVersionUID = 1L;

	private long tagID;
	private String mID;
	private String tagName;
	private String notableName;

	public long getTagID() {
		return tagID;
	}

	public void setTagID(long tagID) {
		this.tagID = tagID;
	}

	public String getTagName() {
		return tagName;
	}

	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Tag) {
			Tag t = (Tag) obj;
			return this.tagID == t.tagID;
		}

		return false;
	}

	public int hashCode() {
		return tagName.hashCode();
	}

	public String getmID() {
		return mID;
	}

	public void setmID(String mID) {
		this.mID = mID;
	}

	public String getNotableName() {
		return notableName;
	}

	public void setNotableName(String notableName) {
		this.notableName = notableName;
	}

	@Override
	public String toString() {
		return String.format("%s %s", tagName, notableName == null ? "" : "("
				+ notableName + ")");
	}
}
